home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / mhavoc.c < prev    next >
Text File  |  2000-05-13  |  25KB  |  619 lines

  1. /***************************************************************************
  2.  
  3. MAJOR HAVOC (Driver)
  4.  
  5. started 7 OCT 97 - Mike Appolo
  6. completed by the MAME vector team
  7.  
  8. Notes:
  9.  
  10. This game was provided in three configurations:
  11. 1) New Machine Purchase
  12. 2) Upgrade kit for Tempest (Kit "A")
  13. 3) Upgrade kit for Space Duel, Gravitar, and Black Window (Kit "B")
  14.  
  15. Controls on the machine were:
  16. A backlit cylinder (roller) on new Major Havoc machines
  17.         or
  18. A Tempest-like spinner on upgrades
  19.  
  20.  
  21. Memory Map for Major Havoc
  22.  
  23. Alpha Processor
  24.                  D  D  D  D  D  D  D  D
  25. Hex Address      7  6  5  4  3  2  1  0                    Function
  26. --------------------------------------------------------------------------------
  27. 0000-01FF     |  D  D  D  D  D  D  D  D   | R/W  | Program RAM (1/2K)
  28. 0200-07FF     |  D  D  D  D  D  D  D  D   | R/W  | Paged Program RAM (3K)
  29. 0800-09FF     |  D  D  D  D  D  D  D  D   | R/W  | Program RAM (1/2K)
  30.               |                           |      |
  31. 1000          |  D  D  D  D  D  D  D  D   |  R   | Gamma Commuication Read Port
  32.               |                           |      |
  33. 1200          |  D                        |  R   | Right Coin (Player 1=0)
  34. 1200          |     D                     |  R   | Left Coin  (Player 1=0)
  35. 1200          |        D                  |  R   | Aux. Coin  (Player 1=0)
  36. 1200          |           D               |  R   | Diagnostic Step
  37. 1200          |  D                        |  R   | Self Test Switch (Player 1=1)
  38. 1200          |     D                     |  R   | Cabinet Switch (Player 1=1)
  39. 1200          |        D                  |  R   | Aux. Coin Switch (Player 1=1)
  40. 1200          |           D               |  R   | Diagnostic Step
  41. 1200          |              D            |  R   | Gammma Rcvd Flag
  42. 1200          |                 D         |  R   | Gamma Xmtd Flag
  43. 1200          |                    D      |  R   | 2.4 KHz
  44. 1200          |                       D   |  R   | Vector Generator Halt Flag
  45.               |                           |      |
  46. 1400-141F     |              D  D  D  D   |  W   | ColorRAM
  47.               |                           |      |
  48. 1600          |  D                        |  W   | Invert X
  49. 1600          |     D                     |  W   | Invert Y
  50. 1600          |        D                  |  W   | Player 1
  51. 1600          |           D               |  W   | Not Used
  52. 1600          |              D            |  W   | Gamma Proc. Reset
  53. 1600          |                 D         |  W   | Beta Proc. Reset
  54. 1600          |                    D      |  W   | Not Used
  55. 1600          |                       D   |  W   | Roller Controller Light
  56.               |                           |      |
  57. 1640          |                           |  W   | Vector Generator Go
  58. 1680          |                           |  W   | Watchdog Clear
  59. 16C0          |                           |  W   | Vector Generator Reset
  60.               |                           |      |
  61. 1700          |                           |  W   | IRQ Acknowledge
  62. 1740          |                    D  D   |  W   | Program ROM Page Select
  63. 1780          |                       D   |  W   | Program RAM Page Select
  64. 17C0          |  D  D  D  D  D  D  D  D   |  W   | Gamma Comm. Write Port
  65.               |                           |      |
  66. 1800-1FFF     |  D  D  D  D  D  D  D  D   | R/W  | Shared Beta RAM(not used)
  67.               |                           |      |
  68. 2000-3FFF     |  D  D  D  D  D  D  D  D   |  R   | Paged Program ROM (32K)
  69. 4000-4FFF     |  D  D  D  D  D  D  D  D   | R/W  | Vector Generator RAM (4K)
  70. 5000-5FFF     |  D  D  D  D  D  D  D  D   |  R   | Vector Generator ROM (4K)
  71. 6000-7FFF     |  D  D  D  D  D  D  D  D   |  R   | Paged Vector ROM (32K)
  72. 8000-FFFF     |  D  D  D  D  D  D  D  D   |  R   | Program ROM (32K)
  73. -------------------------------------------------------------------------------
  74.  
  75. Gamma Processor
  76.  
  77.                  D  D  D  D  D  D  D  D
  78. Hex Address      7  6  5  4  3  2  1  0                    Function
  79. --------------------------------------------------------------------------------
  80. 0000-07FF     |  D  D  D  D  D  D  D  D   | R/W  | Program RAM (2K)
  81. 2000-203F     |  D  D  D  D  D  D  D  D   | R/W  | Quad-Pokey I/O
  82.               |                           |      |
  83. 2800          |  D                        |  R   | Fire 1 Switch
  84. 2800          |     D                     |  R   | Shield 1 Switch
  85. 2800          |        D                  |  R   | Fire 2 Switch
  86. 2800          |           D               |  R   | Shield 2 Switch
  87. 2800          |              D            |  R   | Not Used
  88. 2800          |                 D         |  R   | Speech Chip Ready
  89. 2800          |                    D      |  R   | Alpha Rcvd Flag
  90. 2800          |                       D   |  R   | Alpha Xmtd Flag
  91.               |                           |      |
  92. 3000          |  D  D  D  D  D  D  D  D   |  R   | Alpha Comm. Read Port
  93.               |                           |      |
  94. 3800-3803     |  D  D  D  D  D  D  D  D   |  R   | Roller Controller Input
  95.               |                           |      |
  96. 4000          |                           |  W   | IRQ Acknowledge
  97. 4800          |                    D      |  W   | Left Coin Counter
  98. 4800          |                       D   |  W   | Right Coin Counter
  99.               |                           |      |
  100. 5000          |  D  D  D  D  D  D  D  D   |  W   | Alpha Comm. Write Port
  101.               |                           |      |
  102. 6000-61FF     |  D  D  D  D  D  D  D  D   | R/W  | EEROM
  103. 8000-BFFF     |  D  D  D  D  D  D  D  D   |  R   | Program ROM (16K)
  104. -----------------------------------------------------------------------------
  105.  
  106.  
  107.  
  108. MAJOR HAVOC DIP SWITCH SETTINGS
  109.  
  110. $=Default
  111.  
  112. DIP Switch at position 13/14S
  113.  
  114.                                   1    2    3    4    5    6    7    8
  115. STARTING LIVES                  _________________________________________
  116. Free Play   1 Coin   2 Coin     |    |    |    |    |    |    |    |    |
  117.     2         3         5      $|Off |Off |    |    |    |    |    |    |
  118.     3         4         4       | On | On |    |    |    |    |    |    |
  119.     4         5         6       | On |Off |    |    |    |    |    |    |
  120.     5         6         7       |Off | On |    |    |    |    |    |    |
  121. GAME DIFFICULTY                 |    |    |    |    |    |    |    |    |
  122. Hard                            |    |    | On | On |    |    |    |    |
  123. Medium                         $|    |    |Off |Off |    |    |    |    |
  124. Easy                            |    |    |Off | On |    |    |    |    |
  125. Demo                            |    |    | On |Off |    |    |    |    |
  126. BONUS LIFE                      |    |    |    |    |    |    |    |    |
  127. 50,000                          |    |    |    |    | On | On |    |    |
  128. 100,000                        $|    |    |    |    |Off |Off |    |    |
  129. 200,000                         |    |    |    |    |Off | On |    |    |
  130. No Bonus Life                   |    |    |    |    | On |Off |    |    |
  131. ATTRACT MODE SOUND              |    |    |    |    |    |    |    |    |
  132. Silence                         |    |    |    |    |    |    | On |    |
  133. Sound                          $|    |    |    |    |    |    |Off |    |
  134. ADAPTIVE DIFFICULTY             |    |    |    |    |    |    |    |    |
  135. No                              |    |    |    |    |    |    |    | On |
  136. Yes                            $|    |    |    |    |    |    |    |Off |
  137.                                 -----------------------------------------
  138.  
  139.     DIP Switch at position 8S
  140.  
  141.                                   1    2    3    4    5    6    7    8
  142.                                 _________________________________________
  143. Free Play                       |    |    |    |    |    |    | On |Off |
  144. 1 Coin for 1 Game               |    |    |    |    |    |    |Off |Off |
  145. 1 Coin for 2 Games              |    |    |    |    |    |    | On | On |
  146. 2 Coins for 1 Game             $|    |    |    |    |    |    |Off | On |
  147. RIGHT COIN MECHANISM            |    |    |    |    |    |    |    |    |
  148. x1                             $|    |    |    |    |Off |Off |    |    |
  149. x4                              |    |    |    |    |Off | On |    |    |
  150. x5                              |    |    |    |    | On |Off |    |    |
  151. x6                              |    |    |    |    | On | On |    |    |
  152. LEFT COIN MECHANISM             |    |    |    |    |    |    |    |    |
  153. x1                             $|    |    |    |Off |    |    |    |    |
  154. x2                              |    |    |    | On |    |    |    |    |
  155. BONUS COIN ADDER                |    |    |    |    |    |    |    |    |
  156. No Bonus Coins                 $|Off |Off |Off |    |    |    |    |    |
  157. Every 4, add 1                  |Off | On |Off |    |    |    |    |    |
  158. Every 4, add 2                  |Off | On | On |    |    |    |    |    |
  159. Every 5, add 1                  | On |Off |Off |    |    |    |    |    |
  160. Every 3, add 1                  | On |Off | On |    |    |    |    |    |
  161.                                 -----------------------------------------
  162.  
  163.     2 COIN MINIMUM OPTION: Short pin 6 @13N to ground.
  164.  
  165.  
  166. ***************************************************************************/
  167. #include "driver.h"
  168. #include "vidhrdw/generic.h"
  169. #include "machine/mathbox.h"
  170. #include "machine/atari_vg.h"
  171. #include "vidhrdw/avgdvg.h"
  172. #include "vidhrdw/vector.h"
  173.  
  174. void mhavoc_init_machine(void);
  175. int mhavoc_alpha_interrupt (void);
  176. int mhavoc_gamma_interrupt (void);
  177. WRITE_HANDLER( mhavoc_rom_banksel_w );
  178. WRITE_HANDLER( mhavoc_ram_banksel_w );
  179. READ_HANDLER( mhavoc_gamma_r );
  180. WRITE_HANDLER( mhavoc_gamma_w );
  181. READ_HANDLER( mhavoc_alpha_r );
  182. WRITE_HANDLER( mhavoc_alpha_w );
  183. READ_HANDLER( mhavoc_port_0_r );
  184. READ_HANDLER( mhavoc_port_1_r );
  185. WRITE_HANDLER( mhavoc_out_0_w );
  186. WRITE_HANDLER( mhavoc_out_1_w );
  187. WRITE_HANDLER( mhavoc_irqack_w );
  188. WRITE_HANDLER( tempest_colorram_w );
  189.  
  190.  
  191.  
  192. static unsigned char *nvram;
  193. static size_t nvram_size;
  194.  
  195. static void nvram_handler(void *file, int read_or_write)
  196. {
  197.     if (read_or_write)
  198.         osd_fwrite(file,nvram,nvram_size);
  199.     else
  200.     {
  201.         if (file)
  202.             osd_fread(file,nvram,nvram_size);
  203.         else
  204.             memset(nvram,0xff,nvram_size);
  205.     }
  206. }
  207.  
  208.  
  209. static unsigned char *gammaram;
  210.  
  211. static READ_HANDLER( mhavoc_gammaram_r )
  212. {
  213.     return gammaram[offset & 0x7ff];
  214. }
  215.  
  216. static WRITE_HANDLER( mhavoc_gammaram_w )
  217. {
  218.     gammaram[offset & 0x7ff] = data;
  219. }
  220.  
  221.  
  222. /* Main board Readmem */
  223. static struct MemoryReadAddress readmem[] =
  224. {
  225.     { 0x0000, 0x01ff, MRA_RAM },            /* 0.5K Program Ram */
  226.     { 0x0200, 0x07ff, MRA_BANK1 },            /* 3K Paged Program RAM    */
  227.     { 0x0800, 0x09ff, MRA_RAM },            /* 0.5K Program RAM */
  228.     { 0x1000, 0x1000, mhavoc_gamma_r },        /* Gamma Read Port */
  229.     { 0x1200, 0x1200, mhavoc_port_0_r },    /* Alpha Input Port 0 */
  230.     { 0x1800, 0x1FFF, MRA_RAM},                /* Shared Beta Ram */
  231.     { 0x2000, 0x3fff, MRA_BANK2 },            /* Paged Program ROM (32K) */
  232.     { 0x4000, 0x4fff, MRA_RAM }, /* Vector RAM    (4K) */
  233.     { 0x5000, 0x5fff, MRA_ROM },            /* Vector ROM (4K) */
  234.     { 0x6000, 0x7fff, MRA_BANK3 },            /* Paged Vector ROM (32K) */
  235.     { 0x8000, 0xffff, MRA_ROM },            /* Program ROM (32K) */
  236.     { -1 }    /* end of table */
  237. };
  238.  
  239.  
  240. /* Main Board Writemem */
  241. static struct MemoryWriteAddress writemem[] =
  242. {
  243.     { 0x0000, 0x01ff, MWA_RAM },            /* 0.5K Program Ram */
  244.     { 0x0200, 0x07ff, MWA_BANK1 },            /* 3K Paged Program RAM */
  245.     { 0x0800, 0x09ff, MWA_RAM },            /* 0.5K Program RAM */
  246.     { 0x1200, 0x1200, MWA_NOP },            /* don't care */
  247.     { 0x1400, 0x141f, mhavoc_colorram_w },    /* ColorRAM */
  248.     { 0x1600, 0x1600, mhavoc_out_0_w },        /* Control Signals */
  249.     { 0x1640, 0x1640, avgdvg_go_w },            /* Vector Generator GO */
  250.     { 0x1680, 0x1680, MWA_NOP },            /* Watchdog Clear */
  251.     { 0x16c0, 0x16c0, avgdvg_reset_w },        /* Vector Generator Reset */
  252.     { 0x1700, 0x1700, MWA_NOP },            /* IRQ ack */
  253.     { 0x1740, 0x1740, mhavoc_rom_banksel_w },/* Program ROM Page Select */
  254.     { 0x1780, 0x1780, mhavoc_ram_banksel_w },/* Program RAM Page Select */
  255.     { 0x17c0, 0x17c0, mhavoc_gamma_w },        /* Gamma Communication Write Port */
  256.     { 0x1800, 0x1fff, MWA_RAM },            /* Shared Beta Ram */
  257.     { 0x2000, 0x3fff, MWA_ROM },            /* Major Havoc writes here.*/
  258.     { 0x4000, 0x4fff, MWA_RAM, &vectorram, &vectorram_size },/* Vector Generator RAM    */
  259.     { 0x6000, 0x7fff, MWA_ROM },
  260.     { -1 }    /* end of table */
  261. };
  262.  
  263.  
  264. /* Gamma board readmem */
  265. static struct MemoryReadAddress gamma_readmem[] =
  266. {
  267.     { 0x0000, 0x07ff, MRA_RAM },            /* Program RAM (2K)    */
  268.     { 0x0800, 0x1fff, mhavoc_gammaram_r },    /* wraps to 0x000-0x7ff */
  269.     { 0x2000, 0x203f, quad_pokey_r },        /* Quad Pokey read    */
  270.     { 0x2800, 0x2800, mhavoc_port_1_r },    /* Gamma Input Port    */
  271.     { 0x3000, 0x3000, mhavoc_alpha_r },        /* Alpha Comm. Read Port*/
  272.     { 0x3800, 0x3803, input_port_2_r },        /* Roller Controller Input*/
  273.     { 0x4000, 0x4000, input_port_4_r },        /* DSW at 8S */
  274.     { 0x6000, 0x61ff, MRA_RAM },            /* EEROM        */
  275.     { 0x8000, 0xffff, MRA_ROM },            /* Program ROM (16K)    */
  276.     { -1 }    /* end of table */
  277. };
  278.  
  279. static struct MemoryWriteAddress gamma_writemem[] =
  280. {
  281.     { 0x0000, 0x07ff, MWA_RAM },            /* Program RAM (2K)    */
  282.     { 0x0800, 0x1fff, mhavoc_gammaram_w, &gammaram },    /* wraps to 0x000-0x7ff */
  283.     { 0x2000, 0x203f, quad_pokey_w },        /* Quad Pokey write    */
  284.     { 0x4000, 0x4000, mhavoc_irqack_w },    /* IRQ Acknowledge    */
  285.     { 0x4800, 0x4800, mhavoc_out_1_w },        /* Coin Counters     */
  286.     { 0x5000, 0x5000, mhavoc_alpha_w },        /* Alpha Comm. Write Port */
  287.     { 0x6000, 0x61ff, MWA_RAM, &nvram, &nvram_size },    /* EEROM        */
  288.     { -1 }    /* end of table */
  289. };
  290.  
  291. INPUT_PORTS_START( mhavoc )
  292.     PORT_START    /* IN0 - alpha (player_1 = 0) */
  293.     PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  294.     /* PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_SERVICE, "Diag Step", KEYCODE_T, IP_JOY_NONE ) */
  295.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  296.     PORT_BITX( 0x20, IP_ACTIVE_LOW, IPT_SERVICE, "Diag Step/Coin C", KEYCODE_F1, IP_JOY_NONE )
  297.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )    /* Left Coin Switch  */
  298.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )    /* Right Coin */
  299.  
  300.     PORT_START    /* IN1 - gamma */
  301.     PORT_BIT ( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  302.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  303.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  304.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  305.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  306.  
  307.     PORT_START    /* IN2 - gamma */
  308.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_REVERSE, 100, 40, 0, 0 )
  309.  
  310.     PORT_START /* DIP Switch at position 13/14S */
  311.     PORT_DIPNAME( 0x01, 0x00, "Adaptive Difficulty" )
  312.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  313.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  314.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  315.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  316.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  317.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
  318.     PORT_DIPSETTING(    0x0c, "50000")
  319.     PORT_DIPSETTING(    0x00, "100000")
  320.     PORT_DIPSETTING(    0x04, "200000")
  321.     PORT_DIPSETTING(    0x08, "None")
  322.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) )
  323.     PORT_DIPSETTING(    0x10, "Easy")
  324.     PORT_DIPSETTING(    0x00, "Medium")
  325.     PORT_DIPSETTING(    0x30, "Hard")
  326.     PORT_DIPSETTING(    0x20, "Demo")
  327.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
  328.     PORT_DIPSETTING(    0x00, "3 (2 in Free Play)")
  329.     PORT_DIPSETTING(    0xc0, "4 (3 in Free Play)")
  330.     PORT_DIPSETTING(    0x80, "5 (4 in Free Play)")
  331.     PORT_DIPSETTING(    0x40, "6 (5 in Free Play)")
  332.  
  333.     PORT_START /* DIP Switch at position 8S */
  334.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
  335.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  336.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  337.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  338.     PORT_DIPSETTING(    0x01, DEF_STR( Free_Play ) )
  339.     PORT_DIPNAME( 0x0c, 0x0c, "Right Coin Mechanism" )
  340.     PORT_DIPSETTING(    0x0c, "x1" )
  341.     PORT_DIPSETTING(    0x08, "x4" )
  342.     PORT_DIPSETTING(    0x04, "x5" )
  343.     PORT_DIPSETTING(    0x00, "x6" )
  344.     PORT_DIPNAME( 0x10, 0x10, "Left Coin Mechanism" )
  345.     PORT_DIPSETTING(    0x10, "x1" )
  346.     PORT_DIPSETTING(    0x00, "x2" )
  347.     PORT_DIPNAME( 0xe0, 0xe0, "Bonus Credits" )
  348.     PORT_DIPSETTING(    0x80, "2 each 4" )
  349.     PORT_DIPSETTING(    0x40, "1 each 3" )
  350.     PORT_DIPSETTING(    0xa0, "1 each 4" )
  351.     PORT_DIPSETTING(    0x60, "1 each 5" )
  352.     PORT_DIPSETTING(    0xe0, "None" )
  353.  
  354.     PORT_START    /* IN5 - dummy for player_1 = 1 on alpha */
  355.     PORT_BIT ( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED )
  356.     PORT_DIPNAME( 0x40, 0x40, "Credit to start" )
  357.     PORT_DIPSETTING(    0x40, "1" )
  358.     PORT_DIPSETTING(    0x00, "2" )
  359.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  360. INPUT_PORTS_END
  361.  
  362. INPUT_PORTS_START( mhavocp )
  363.     PORT_START    /* IN0 - alpha (player_1 = 0) */
  364.     PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  365.     /* PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_SERVICE, "Diag Step", KEYCODE_T, IP_JOY_NONE ) */
  366.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  367.     PORT_BITX( 0x20, IP_ACTIVE_LOW, IPT_SERVICE, "Diag Step/Coin C", KEYCODE_F1, IP_JOY_NONE )
  368.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )    /* Left Coin Switch  */
  369.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )    /* Right Coin */
  370.  
  371.     PORT_START    /* IN1 - gamma */
  372.     PORT_BIT ( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  373.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  374.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  375.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  376.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  377.  
  378.     PORT_START    /* IN2 - gamma */
  379.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_REVERSE, 100, 40, 0, 0 )
  380.  
  381.     PORT_START /* DIP Switch at position 13/14S */
  382.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  383.     PORT_DIPSETTING(    0x00, "1" )
  384.     PORT_DIPSETTING(    0x01, "2" )
  385.     PORT_DIPSETTING(    0x02, "3" )
  386.     PORT_DIPSETTING(    0x03, "4" )
  387.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
  388.     PORT_DIPSETTING(    0x0c, "50000")
  389.     PORT_DIPSETTING(    0x00, "100000")
  390.     PORT_DIPSETTING(    0x04, "200000")
  391.     PORT_DIPSETTING(    0x08, "None")
  392.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) )
  393.     PORT_DIPSETTING(    0x10, "Easy")
  394.     PORT_DIPSETTING(    0x00, "Medium")
  395.     PORT_DIPSETTING(    0x30, "Hard")
  396.     PORT_DIPSETTING(    0x20, "Demo")
  397.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
  398.     PORT_DIPSETTING(    0x00, "3 (2 in Free Play)")
  399.     PORT_DIPSETTING(    0xc0, "4 (3 in Free Play)")
  400.     PORT_DIPSETTING(    0x80, "5 (4 in Free Play)")
  401.     PORT_DIPSETTING(    0x40, "6 (5 in Free Play)")
  402.  
  403.     PORT_START /* DIP Switch at position 8S */
  404.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
  405.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  406.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  407.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  408.     PORT_DIPSETTING(    0x01, DEF_STR( Free_Play ) )
  409.     PORT_DIPNAME( 0x0c, 0x0c, "Right Coin Mechanism" )
  410.     PORT_DIPSETTING(    0x0c, "x1" )
  411.     PORT_DIPSETTING(    0x08, "x4" )
  412.     PORT_DIPSETTING(    0x04, "x5" )
  413.     PORT_DIPSETTING(    0x00, "x6" )
  414.     PORT_DIPNAME( 0x10, 0x10, "Left Coin Mechanism" )
  415.     PORT_DIPSETTING(    0x10, "x1" )
  416.     PORT_DIPSETTING(    0x00, "x2" )
  417.     PORT_DIPNAME( 0xe0, 0xe0, "Bonus Credits" )
  418.     PORT_DIPSETTING(    0x80, "2 each 4" )
  419.     PORT_DIPSETTING(    0x40, "1 each 3" )
  420.     PORT_DIPSETTING(    0xa0, "1 each 4" )
  421.     PORT_DIPSETTING(    0x60, "1 each 5" )
  422.     PORT_DIPSETTING(    0xe0, "None" )
  423.  
  424.     PORT_START    /* IN5 - dummy for player_1 = 1 on alpha */
  425.     PORT_BIT ( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED )
  426.     PORT_DIPNAME( 0x40, 0x40, "Credit to start" )
  427.     PORT_DIPSETTING(    0x40, "1" )
  428.     PORT_DIPSETTING(    0x00, "2" )
  429.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  430. INPUT_PORTS_END
  431.  
  432.  
  433.  
  434. static struct POKEYinterface pokey_interface =
  435. {
  436.     4,    /* 4 chips */
  437.     1250000,    /* 1.25 MHz??? */
  438.     { 25, 25, 25, 25 },
  439.     /* The 8 pot handlers */
  440.     { 0, 0, 0, 0 },
  441.     { 0, 0, 0, 0 },
  442.     { 0, 0, 0, 0 },
  443.     { 0, 0, 0, 0 },
  444.     { 0, 0, 0, 0 },
  445.     { 0, 0, 0, 0 },
  446.     { 0, 0, 0, 0 },
  447.     { 0, 0, 0, 0 },
  448.     /* The allpot handler */
  449.     { input_port_3_r, 0, 0, 0 },
  450. };
  451.  
  452.  
  453.  
  454. static struct MachineDriver machine_driver_mhavoc =
  455. {
  456.     /* basic machine hardware */
  457.     {
  458.         {
  459.             CPU_M6502,
  460.             2500000,    /* 2.5 Mhz */
  461.             readmem,writemem,0,0,
  462.             interrupt,8 /* 2.4576 milliseconds period */
  463.         },
  464.         {
  465.             CPU_M6502,
  466.             1250000,    /* 1.25 Mhz */
  467.             gamma_readmem,gamma_writemem,0,0,
  468.             0, 0, /* no vblank interrupt */
  469. #if 0        /* HJB has it's own timer in machine/mhavoc now */
  470.             interrupt, 305 /* 3.2768 milliseconds period? */
  471. #endif
  472.         }
  473.     },
  474.     50, 0,    /* frames per second, vblank duration (vector game, so no vblank) */
  475.             /* fps should be 30, but MH draws "empty" frames */
  476.     1,        /* 1 CPU slice. see machine.c */
  477.     mhavoc_init_machine,
  478.  
  479.     /* video hardware */
  480.     400, 300, { 0, 300, 0, 260 },
  481.     0,
  482.     256,0,
  483.     avg_init_palette_multi,
  484.  
  485.     VIDEO_TYPE_VECTOR,
  486.     0,
  487.     avg_start_mhavoc,
  488.     avg_stop,
  489.     vector_vh_screenrefresh,
  490.  
  491.     /* sound hardware */
  492.     0,0,0,0,
  493.     {
  494.         {
  495.             SOUND_POKEY,
  496.             &pokey_interface
  497.         }
  498.     },
  499.  
  500.     nvram_handler
  501. };
  502.  
  503.  
  504. /*
  505.  * Notes:
  506.  * the R3 roms are supported as "mhavoc", the R2 roms (with a bug in gameplay)
  507.  * are supported as "mhavoc2".
  508.  * "Return to Vax" - Jess Askey's souped up version (errors on self test)
  509.  * are supported as "mhavocrv".
  510.  * Prototype is supported as "mhavocp"
  511.  */
  512.  
  513. ROM_START( mhavoc )
  514.     /* Alpha Processor ROMs */
  515.     ROM_REGION( 0x21000, REGION_CPU1 )    /* 152KB for ROMs */
  516.     /* Vector Generator ROM */
  517.     ROM_LOAD( "136025.210",   0x05000, 0x2000, 0xc67284ca )
  518.  
  519.     /* Program ROM */
  520.     ROM_LOAD( "136025.216",   0x08000, 0x4000, 0x522a9cc0 )
  521.     ROM_LOAD( "136025.217",   0x0c000, 0x4000, 0xea3d6877 )
  522.  
  523.     /* Paged Program ROM */
  524.     ROM_LOAD( "136025.215",   0x10000, 0x4000, 0xa4d380ca ) /* page 0+1 */
  525.     ROM_LOAD( "136025.318",   0x14000, 0x4000, 0xba935067 ) /* page 2+3 */
  526.  
  527.     /* Paged Vector Generator ROM */
  528.     ROM_LOAD( "136025.106",   0x18000, 0x4000, 0x2ca83c76 ) /* page 0+1 */
  529.     ROM_LOAD( "136025.107",   0x1c000, 0x4000, 0x5f81c5f3 ) /* page 2+3 */
  530.  
  531.     /* Gamma Processor ROM */
  532.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 16k for code */
  533.     ROM_LOAD( "136025.108",   0x08000, 0x4000, 0x93faf210 )
  534.     ROM_RELOAD(               0x0c000, 0x4000 ) /* reset+interrupt vectors */
  535. ROM_END
  536.  
  537. ROM_START( mhavoc2 )
  538.     /* Alpha Processor ROMs */
  539.     ROM_REGION( 0x21000, REGION_CPU1 )
  540.     /* Vector Generator ROM */
  541.     ROM_LOAD( "136025.110",   0x05000, 0x2000, 0x16eef583 )
  542.  
  543.     /* Program ROM */
  544.     ROM_LOAD( "136025.103",   0x08000, 0x4000, 0xbf192284 )
  545.     ROM_LOAD( "136025.104",   0x0c000, 0x4000, 0x833c5d4e )
  546.  
  547.     /* Paged Program ROM - switched to 2000-3fff */
  548.     ROM_LOAD( "136025.101",   0x10000, 0x4000, 0x2b3b591f ) /* page 0+1 */
  549.     ROM_LOAD( "136025.109",   0x14000, 0x4000, 0x4d766827 ) /* page 2+3 */
  550.  
  551.     /* Paged Vector Generator ROM */
  552.     ROM_LOAD( "136025.106",   0x18000, 0x4000, 0x2ca83c76 ) /* page 0+1 */
  553.     ROM_LOAD( "136025.107",   0x1c000, 0x4000, 0x5f81c5f3 ) /* page 2+3 */
  554.  
  555.     /* the last 0x1000 is used for the 2 RAM pages */
  556.  
  557.     /* Gamma Processor ROM */
  558.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 16k for code */
  559.     ROM_LOAD( "136025.108",   0x08000, 0x4000, 0x93faf210 )
  560.     ROM_RELOAD(               0x0c000, 0x4000 ) /* reset+interrupt vectors */
  561. ROM_END
  562.  
  563. ROM_START( mhavocrv )
  564.     /* Alpha Processor ROMs */
  565.     ROM_REGION( 0x21000, REGION_CPU1 )    /* 152KB for ROMs */
  566.     /* Vector Generator ROM */
  567.     ROM_LOAD( "136025.210",   0x05000, 0x2000, 0xc67284ca )
  568.  
  569.     /* Program ROM */
  570.     ROM_LOAD( "136025.916",   0x08000, 0x4000, 0x1255bd7f )
  571.     ROM_LOAD( "136025.917",   0x0c000, 0x4000, 0x21889079 )
  572.  
  573.     /* Paged Program ROM */
  574.     ROM_LOAD( "136025.915",   0x10000, 0x4000, 0x4c7235dc ) /* page 0+1 */
  575.     ROM_LOAD( "136025.918",   0x14000, 0x4000, 0x84735445 ) /* page 2+3 */
  576.  
  577.     /* Paged Vector Generator ROM */
  578.     ROM_LOAD( "136025.106",   0x18000, 0x4000, 0x2ca83c76 ) /* page 0+1 */
  579.     ROM_LOAD( "136025.907",   0x1c000, 0x4000, 0x4deea2c9 ) /* page 2+3 */
  580.  
  581.     /* Gamma Processor ROM */
  582.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 16k for code */
  583.     ROM_LOAD( "136025.908",   0x08000, 0x4000, 0xc52ec664 )
  584.     ROM_RELOAD(               0x0c000, 0x4000 ) /* reset+interrupt vectors */
  585. ROM_END
  586.  
  587. ROM_START( mhavocp )
  588.     /* Alpha Processor ROMs */
  589.     ROM_REGION( 0x21000, REGION_CPU1 )
  590.     /* Vector Generator ROM */
  591.     ROM_LOAD( "136025.010",   0x05000, 0x2000, 0x3050c0e6 )
  592.  
  593.     /* Program ROM */
  594.     ROM_LOAD( "136025.016",   0x08000, 0x4000, 0x94caf6c0 )
  595.     ROM_LOAD( "136025.017",   0x0c000, 0x4000, 0x05cba70a )
  596.  
  597.     /* Paged Program ROM - switched to 2000-3fff */
  598.     ROM_LOAD( "136025.015",   0x10000, 0x4000, 0xc567c11b )
  599.     ROM_LOAD( "136025.018",   0x14000, 0x4000, 0xa8c35ccd )
  600.  
  601.     /* Paged Vector Generator ROM */
  602.     ROM_LOAD( "136025.006",   0x18000, 0x4000, 0xe272ed41 )
  603.     ROM_LOAD( "136025.007",   0x1c000, 0x4000, 0xe152c9d8 )
  604.  
  605.     /* the last 0x1000 is used for the 2 RAM pages */
  606.  
  607.     /* Gamma Processor ROM */
  608.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 16k for code */
  609.     ROM_LOAD( "136025.008",   0x8000, 0x4000, 0x22ea7399 )
  610.     ROM_RELOAD(               0xc000, 0x4000 )/* reset+interrupt vectors */
  611. ROM_END
  612.  
  613.  
  614.  
  615. GAME( 1983, mhavoc,   0,      mhavoc, mhavoc,  0, ROT0, "Atari", "Major Havoc (rev 3)" )
  616. GAME( 1983, mhavoc2,  mhavoc, mhavoc, mhavoc,  0, ROT0, "Atari", "Major Havoc (rev 2)" )
  617. GAME( 1983, mhavocrv, mhavoc, mhavoc, mhavoc,  0, ROT0, "hack", "Major Havoc (Return to Vax)" )
  618. GAME( 1983, mhavocp,  mhavoc, mhavoc, mhavocp, 0, ROT0, "Atari", "Major Havoc (prototype)" )
  619.